package com.ryskoo.customer.applogin.service;

import com.ryskoo.customer.applogin.domain.AppLoginTokenPO;
import com.ryskoo.customer.applogin.repository.IAppLoginTokenRepository;
import com.ryskoo.framework.core.service.BasicServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.PostConstruct;

/**
 * 移动端登录令牌接口
 * 
 * @author huanghe
 *
 */
@Service
@Transactional
public class AppLoginTokenServiceImpl extends BasicServiceImpl<AppLoginTokenPO> implements IAppLoginTokenService {

	@Autowired
	private IAppLoginTokenRepository appLoginTokenRepository;

	@PostConstruct
	public void init() {
		this.setDao(appLoginTokenRepository);
	}

	/**
	 * 根据 token和员工uuid 获取登录令牌
	 * @param token
	 * @param managerUuid
	 */
	@Override
	public AppLoginTokenPO getByTokenAndManager(String token,String managerUuid){
		return appLoginTokenRepository.getByTokenAndManager(token,managerUuid);
	}

}
